<!-- Load TinyMCE -->
<script type="text/javascript" src="media/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript" src="media/tiny_mce/config.js"></script>
<script type="text/javascript" src="media/js/jquery.validate.min.js"></script>
<script type="text/javascript">
tiny('detail');
$(function(){
	$("#frmMain").validate({
		rules: 
		{
			"title": 
			{ 
				required: true
			}
		},
		messages:
		{
			"title": 
			{ 
				required: "กรุณากรอกหัวข้อค่ะ"
			}
		}
	});		
})
</script>
<h1>ข่าวประชาสัมพันธ์</h1>
<form id="frmMain" action="new_informations/admin/new_informations/save/<?php echo $information->id ?>" method="post" enctype="multipart/form-data" >
	
<table class="form">
	<tr>
		<th></th>
		<td>
			<?php if($information->image != ""):?><?php echo thumb("uploads/information/".$information->image,120,70,1);?><?php endif;?>
		</td>
	</tr>
	<tr><th>รูปภาพ :</th><td><input type="file" name="image" /></td></tr>
	<tr><th>หมวดหมู่ :</th><td><?php echo form_dropdown('category_id',$information->category->get_option(),$information->category_id,'');?></td></tr>
	<tr>
		<th>หัวข้อ :</th>
		<td>
			<input type="text" name="title" rel="th" value="<?php echo $information->title?>" class="full" />
		</td>
	</tr>
	<tr>
		<th>รายละเอียด :</th>
		<td>
			<div rel="th"><textarea name="detail" class="full tinymce"><?php echo $information->detail?></textarea></div>
			
		</td>
	</tr>
	<!-- <tr>
		<th>แสดงข่าว :</th>
		<td>
			<input type="checkbox" name="index_show" value="yes" <?php echo ($information->index_show == "yes")?"checked":"";?>> หน้าแรก
			<input type="checkbox" name="tumbon_show" value="yes" <?php echo ($information->tumbon_show == "yes")?"checked":"";?>> ตำบลต้นแบบ
			<input type="checkbox" name="pormor_show" value="yes" <?php echo ($information->pormor_show == "yes")?"checked":"";?>> เครือข่าย พม.
			<input type="checkbox" name="stat_show" value="yes" <?php echo ($information->stat_show == "yes")?"checked":"";?>> วิชาการและสถิติ
		</td>
	</tr> -->
	<tr><th>เริ่ม :</th><td><input type="text" name="start_date" value="<?php echo DB2Date(($information->start_date)?$information->start_date:date("Y-m-d"))?>" class="datepicker" /></td></tr>
	<tr><th>สิ้นสุด :</th><td><input type="text" name="end_date" value="<?php echo DB2Date($information->end_date)?>" class="datepicker" /></td></tr>
	<tr><th></th><td><input type="submit" value="บันทึก" /><?php echo form_back() ?></td></tr>
</table>
<?php echo form_referer() ?>
</form>